package city.spring.modules.medicine.repository;

import city.spring.modules.medicine.entity.MedicineInventorydeliveryEntity;
import city.spring.modules.medicine.vo.MedicineInventorydeliveryVO;
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 存储库：药品盘点出库表
 *
 * @author 谢金婷
 * @date 2020-07-13 11:24:32
 */
@Repository
public interface MedicineInventorydeliveryRepository extends BaseMapper<MedicineInventorydeliveryEntity> {

    /**
     * 据盘点id筛选盘点出库记录
     *
     * @param page
     * @param wrapper
     * @param inventoryId
     * @return
     */
    IPage<MedicineInventorydeliveryEntity> getDeliveryByInventoryId(IPage<MedicineInventorydeliveryEntity> page, AbstractWrapper wrapper, String inventoryId);

    /**
     * 根据id获取药品盘点出库信息
     *
     * @param id
     * @return
     */
    MedicineInventorydeliveryEntity getById(String id);

    IPage<MedicineInventorydeliveryVO> listPage(Page<? extends MedicineInventorydeliveryEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MedicineInventorydeliveryEntity> wrapper);
}